package day22;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * 题目：小易的升级之路
 * 题目链接：https://www.nowcoder.com/practice/fe6c73cb899c4fe1bdd773f8d3b42c3d?tpId=49&&tqId=29329&rp=1&ru=/activity/oj&qru=/ta/2016test/question-ranking
 */
public class Main {
    public static int gcd(int a,int b) {
        while (a != b) {
            if(a > b) {
                a = a-b;
            } else {
                b = b-a;
            }
        }
        return a;
    }
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int num=sc.nextInt();
            int power=sc.nextInt();
            int[] arr=new int[num];
            for(int i=0;i<num;i++){
                arr[i]=sc.nextInt();
            }
            for(int i=0;i<num;i++){
                if(power>=arr[i]){
                    power=power+arr[i];
                }else{
                    power+=gcd(power,arr[i]);
                }
            }
            System.out.println(power);
        }
    }
}
